import request from '@/config/axios'

export interface HomeEmployeeVO {
  id: number
  agentCode: string
  systemUserCode: string
  nickname: string
  serviceYear: number
  hasReference: boolean
  referenceSystemUserCode: string
  hasHomeEmployee: boolean
  hasStoreEmployee: boolean
}

// 查询到家员工关系分页
export const getHomeEmployeePage = async (params) => {
  return await request.get({ url: `/meijia/home-employee/page`, params })
}

// 查询到家员工关系详情
export const getHomeEmployee = async (id: number) => {
  return await request.get({ url: `/meijia/home-employee/get?id=` + id })
}

// 新增到家员工关系
export const createHomeEmployee = async (data: HomeEmployeeVO) => {
  return await request.post({ url: `/meijia/home-employee/create`, data })
}

// 修改到家员工关系
export const updateHomeEmployee = async (data: HomeEmployeeVO) => {
  return await request.put({ url: `/meijia/home-employee/update`, data })
}

// 删除到家员工关系
export const deleteHomeEmployee = async (id: number) => {
  return await request.delete({ url: `/meijia/home-employee/delete?id=` + id })
}

// 导出到家员工关系 Excel
export const exportHomeEmployee = async (params) => {
  return await request.download({ url: `/meijia/home-employee/export-excel`, params })
}
// 获得门店可绑定的普通员工（康美师）
export const getBindableOrdinaryEmployeeList = async (params) => {
  return await request.get({ url: `/meijia/home-employee/get-bindable-ordinary-employee-list`, params })
}
// 根据员工姓名搜索康美师
export const getListBySystemUserName = async (systemUserName:string) => {
  return await request.get({ url: `/meijia/home-employee/list-by-system-user-name?systemUserName=`+systemUserName})
}